package com.fumin.service.impl;

import com.fumin.mapper.CoinCountMapper;
import com.fumin.pojo.CoinCount;
import com.fumin.service.CoinCountService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * Created by Lingo on 2018/2/13.
 */
@Service
public class CoinCountServiceImpl implements CoinCountService {


    @Resource
    CoinCountMapper coinCountMapper;

    @Override
    public int deleteByPrimaryKey(String pk) {
        return coinCountMapper.deleteByPrimaryKey(pk);
    }

    @Override
    public int insert(CoinCount record) {
        return coinCountMapper.insert(record);
    }

    @Override
    public int insertSelective(CoinCount record) {
        return coinCountMapper.insertSelective(record);
    }

    @Override
    public CoinCount selectByPrimaryKey(String pk) {
        return coinCountMapper.selectByPrimaryKey(pk);
    }

    @Override
    public int updateByPrimaryKeySelective(CoinCount record) {
        return coinCountMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(CoinCount record) {
        return coinCountMapper.updateByPrimaryKey(record);
    }


    @Override
    public int insertMany(List<CoinCount> list) {
        return coinCountMapper.insertMany(list);
    }

    @Override
    public List<CoinCount> selectByUserPk(Long userPk, Integer level) {
        return coinCountMapper.selectByUserPk(userPk,level);
    }

    @Override
    public Map<String, BigDecimal> selectTotalCoin() {
        return coinCountMapper.selectTotalCoin();
    }
}
